<?php
namespace Avalanche\Model;

use Avalanche\Model;

/**
 * Request Model provide request information
 *
 * @author Vitold Sedyshev
 */
class RequestModel extends Model {

    /**
     * @var string
     */
    protected $method;

    /**
     * @var string
     */
    protected $uri;

    /**
     * @var string
     */
    protected $protocol;

    /**
     * Headers
     *
     * @var array
     */
    protected $headers = array();

    /**
     * Set header
     *
     * @param string $name
     * @param string $value
     */
    public function setHeader($name, $value) {
        $this->headers[$name] = $value;
    }

    /**
     * Get header
     *
     * @param string $name
     * @return string
     */
    public function getHeader($name) {
        $result = null;
        if (array_key_exists($name, $this->headers)) {
            $result = $this->headers[$name];
        }
        return $result;
    }

    /**
     * @param string $method
     */
    public function setMethod($method)
    {
        $this->method = $method;
    }

    /**
     * @param string $uri
     */
    public function setURI($uri)
    {
        $this->uri = $uri;
    }

    /**
     * @param string $protocol
     */
    public function setProtocol($protocol)
    {
        $this->protocol = $protocol;
    }

    /**
     * @return string
     */
    public function getURI()
    {
        return $this->uri;
    }

    /**
     * @return string
     */
    public function getMethod()
    {
        return $this->method;
    }

}